<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<input type="text" @input="handleInput()" v-model="mytext">
			<ul>
				<li v-for="item in datalist" :key="item">
					{{item}}
				</li>
			</ul>
		</div>
		<script>
			var vm = new Vue({
				// :key="item
				el: '#app',
				data: {
					mytext: "",
					datalist: ["aaa", "add", "bbb", "bbc", "ccc", "ddd", "abd"]
				},
				methods: {
					handleInput() {
						console.log("input", this.mytext)
						this.datalist = this.datalist.filter(item => item.includes(this.mytext))
					}
				}
			})
		</script>
	</body>
</html>